.class public Lcom/instagram/android/rageshake/c;
.super Ljava/lang/Object;
.source "SensorHelper.java"


# instance fields
.field private a:Landroid/app/Activity;

.field private b:Landroid/hardware/SensorManager;

.field private c:Z

.field private d:Lcom/instagram/ui/a/a;

.field private e:Lcom/instagram/android/rageshake/b;

.field private f:Lcom/facebook/j/a;

.field private g:Landroid/content/DialogInterface$OnClickListener;

.field private h:Landroid/content/DialogInterface$OnClickListener;


# direct methods
.method public constructor <init>(Landroid/app/Activity;)V
    .locals 1
    .parameter

    .prologue
    .line 34
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 39
    new-instance v0, Lcom/instagram/android/rageshake/d;

    invoke-direct {v0, p0}, Lcom/instagram/android/rageshake/d;-><init>(Lcom/instagram/android/rageshake/c;)V

    iput-object v0, p0, Lcom/instagram/android/rageshake/c;->f:Lcom/facebook/j/a;

    .line 58
    new-instance v0, Lcom/instagram/android/rageshake/e;

    invoke-direct {v0, p0}, Lcom/instagram/android/rageshake/e;-><init>(Lcom/instagram/android/rageshake/c;)V

    iput-object v0, p0, Lcom/instagram/android/rageshake/c;->g:Landroid/content/DialogInterface$OnClickListener;

    .line 75
    new-instance v0, Lcom/instagram/android/rageshake/f;

    invoke-direct {v0, p0}, Lcom/instagram/android/rageshake/f;-><init>(Lcom/instagram/android/rageshake/c;)V

    iput-object v0, p0, Lcom/instagram/android/rageshake/c;->h:Landroid/content/DialogInterface$OnClickListener;

    .line 35
    iput-object p1, p0, Lcom/instagram/android/rageshake/c;->a:Landroid/app/Activity;

    .line 36
    const-string v0, "sensor"

    invoke-virtual {p1, v0}, Landroid/app/Activity;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/hardware/SensorManager;

    iput-object v0, p0, Lcom/instagram/android/rageshake/c;->b:Landroid/hardware/SensorManager;

    .line 37
    return-void
.end method

.method static synthetic a(Lcom/instagram/android/rageshake/c;Lcom/instagram/android/rageshake/b;)Lcom/instagram/android/rageshake/b;
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 24
    iput-object p1, p0, Lcom/instagram/android/rageshake/c;->e:Lcom/instagram/android/rageshake/b;

    return-object p1
.end method

.method public static a(Landroid/content/Context;)Z
    .locals 2
    .parameter

    .prologue
    .line 100
    invoke-static {}, Lcom/instagram/i/a;->d()Z

    move-result v0

    .line 101
    invoke-static {}, Lcom/instagram/service/a;->a()Lcom/instagram/service/a;

    move-result-object v1

    invoke-virtual {v1}, Lcom/instagram/service/a;->d()Z

    move-result v1

    .line 103
    if-nez v0, :cond_0

    if-eqz v1, :cond_0

    const/4 v0, 0x1

    :goto_0
    return v0

    :cond_0
    const/4 v0, 0x0

    goto :goto_0
.end method

.method static synthetic a(Lcom/instagram/android/rageshake/c;)Z
    .locals 1
    .parameter

    .prologue
    .line 24
    iget-boolean v0, p0, Lcom/instagram/android/rageshake/c;->c:Z

    return v0
.end method

.method static synthetic a(Lcom/instagram/android/rageshake/c;Z)Z
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 24
    iput-boolean p1, p0, Lcom/instagram/android/rageshake/c;->c:Z

    return p1
.end method

.method static synthetic b(Lcom/instagram/android/rageshake/c;)V
    .locals 0
    .parameter

    .prologue
    .line 24
    invoke-direct {p0}, Lcom/instagram/android/rageshake/c;->d()V

    return-void
.end method

.method static synthetic c(Lcom/instagram/android/rageshake/c;)Lcom/facebook/j/a;
    .locals 1
    .parameter

    .prologue
    .line 24
    iget-object v0, p0, Lcom/instagram/android/rageshake/c;->f:Lcom/facebook/j/a;

    return-object v0
.end method

.method static synthetic d(Lcom/instagram/android/rageshake/c;)Landroid/app/Activity;
    .locals 1
    .parameter

    .prologue
    .line 24
    iget-object v0, p0, Lcom/instagram/android/rageshake/c;->a:Landroid/app/Activity;

    return-object v0
.end method

.method private d()V
    .locals 3

    .prologue
    .line 49
    new-instance v0, Lcom/instagram/ui/a/a;

    iget-object v1, p0, Lcom/instagram/android/rageshake/c;->a:Landroid/app/Activity;

    invoke-direct {v0, v1}, Lcom/instagram/ui/a/a;-><init>(Landroid/content/Context;)V

    iput-object v0, p0, Lcom/instagram/android/rageshake/c;->d:Lcom/instagram/ui/a/a;

    .line 50
    iget-object v0, p0, Lcom/instagram/android/rageshake/c;->d:Lcom/instagram/ui/a/a;

    sget v1, Lcom/facebook/ba;->rageshake_title:I

    invoke-virtual {v0, v1}, Lcom/instagram/ui/a/a;->b(I)Lcom/instagram/ui/a/a;

    .line 51
    iget-object v0, p0, Lcom/instagram/android/rageshake/c;->d:Lcom/instagram/ui/a/a;

    sget v1, Lcom/facebook/ba;->rageshake_question:I

    invoke-virtual {v0, v1}, Lcom/instagram/ui/a/a;->a(I)Lcom/instagram/ui/a/a;

    .line 52
    iget-object v0, p0, Lcom/instagram/android/rageshake/c;->d:Lcom/instagram/ui/a/a;

    const/4 v1, 0x1

    invoke-virtual {v0, v1}, Lcom/instagram/ui/a/a;->a(Z)Lcom/instagram/ui/a/a;

    .line 53
    iget-object v0, p0, Lcom/instagram/android/rageshake/c;->d:Lcom/instagram/ui/a/a;

    sget v1, Lcom/facebook/ba;->no:I

    iget-object v2, p0, Lcom/instagram/android/rageshake/c;->h:Landroid/content/DialogInterface$OnClickListener;

    invoke-virtual {v0, v1, v2}, Lcom/instagram/ui/a/a;->b(ILandroid/content/DialogInterface$OnClickListener;)Lcom/instagram/ui/a/a;

    .line 54
    iget-object v0, p0, Lcom/instagram/android/rageshake/c;->d:Lcom/instagram/ui/a/a;

    sget v1, Lcom/facebook/ba;->yes:I

    iget-object v2, p0, Lcom/instagram/android/rageshake/c;->g:Landroid/content/DialogInterface$OnClickListener;

    invoke-virtual {v0, v1, v2}, Lcom/instagram/ui/a/a;->a(ILandroid/content/DialogInterface$OnClickListener;)Lcom/instagram/ui/a/a;

    .line 55
    iget-object v0, p0, Lcom/instagram/android/rageshake/c;->d:Lcom/instagram/ui/a/a;

    invoke-virtual {v0}, Lcom/instagram/ui/a/a;->b()Landroid/app/Dialog;

    move-result-object v0

    invoke-virtual {v0}, Landroid/app/Dialog;->show()V

    .line 56
    return-void
.end method

.method static synthetic e(Lcom/instagram/android/rageshake/c;)Lcom/instagram/android/rageshake/b;
    .locals 1
    .parameter

    .prologue
    .line 24
    iget-object v0, p0, Lcom/instagram/android/rageshake/c;->e:Lcom/instagram/android/rageshake/b;

    return-object v0
.end method


# virtual methods
.method public a()V
    .locals 2

    .prologue
    const/4 v1, 0x0

    .line 85
    iget-object v0, p0, Lcom/instagram/android/rageshake/c;->e:Lcom/instagram/android/rageshake/b;

    if-eqz v0, :cond_0

    .line 86
    iget-object v0, p0, Lcom/instagram/android/rageshake/c;->e:Lcom/instagram/android/rageshake/b;

    invoke-virtual {v0}, Lcom/instagram/android/rageshake/b;->a()V

    .line 87
    iput-object v1, p0, Lcom/instagram/android/rageshake/c;->e:Lcom/instagram/android/rageshake/b;

    .line 89
    :cond_0
    iget-object v0, p0, Lcom/instagram/android/rageshake/c;->d:Lcom/instagram/ui/a/a;

    if-eqz v0, :cond_1

    .line 90
    iget-object v0, p0, Lcom/instagram/android/rageshake/c;->d:Lcom/instagram/ui/a/a;

    invoke-virtual {v0}, Lcom/instagram/ui/a/a;->a()V

    .line 91
    iput-object v1, p0, Lcom/instagram/android/rageshake/c;->d:Lcom/instagram/ui/a/a;

    .line 93
    :cond_1
    iput-object v1, p0, Lcom/instagram/android/rageshake/c;->a:Landroid/app/Activity;

    .line 94
    return-void
.end method

.method public b()V
    .locals 4

    .prologue
    .line 107
    iget-object v0, p0, Lcom/instagram/android/rageshake/c;->b:Landroid/hardware/SensorManager;

    iget-object v1, p0, Lcom/instagram/android/rageshake/c;->f:Lcom/facebook/j/a;

    iget-object v2, p0, Lcom/instagram/android/rageshake/c;->b:Landroid/hardware/SensorManager;

    const/4 v3, 0x1

    invoke-virtual {v2, v3}, Landroid/hardware/SensorManager;->getDefaultSensor(I)Landroid/hardware/Sensor;

    move-result-object v2

    const/4 v3, 0x2

    invoke-virtual {v0, v1, v2, v3}, Landroid/hardware/SensorManager;->registerListener(Landroid/hardware/SensorEventListener;Landroid/hardware/Sensor;I)Z

    .line 110
    return-void
.end method

.method public c()V
    .locals 2

    .prologue
    .line 113
    iget-object v0, p0, Lcom/instagram/android/rageshake/c;->b:Landroid/hardware/SensorManager;

    iget-object v1, p0, Lcom/instagram/android/rageshake/c;->f:Lcom/facebook/j/a;

    invoke-virtual {v0, v1}, Landroid/hardware/SensorManager;->unregisterListener(Landroid/hardware/SensorEventListener;)V

    .line 114
    return-void
.end method
